<?
namespace D3hdv\HdvBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use D3hdv\Diablo3Bundle\Entity\D3ObjetType;
use D3hdv\Diablo3Bundle\Entity\D3ObjetClasse;
use D3hdv\Diablo3Bundle\Entity\D3ObjetRarete;
use D3hdv\Diablo3Bundle\Entity\D3ObjetCaracValeur;
use D3hdv\Diablo3Bundle\Form\D3ObjetCaracValeurType;

class HdvRechercheDiablo3ObjetForm extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {       

        $builder->add('prix', 'integer', array(
    	'required'  => false
	));

        $builder->add('nom', 'text',array(
    	'required'  => false
	));
	$builder->add('spe', 'integer', array(
    	'required'  => false
	));
	$builder->add('niveau', 'integer', array(
    	'required'  => false
	));
	$builder->add('Type','entity', array(
	            		'class' => 'D3hdvDiablo3Bundle:D3ObjetType',
	            		'property' => 'objetType',
				'required'  => false));
        $builder->add('Classe','entity', array(
	            		'class' => 'D3hdvDiablo3Bundle:D3ObjetClasse',
	            		'property' => 'objetClasse',
				'required'  => false));
        $builder->add('Rarete','entity', array(
	            		'class' => 'D3hdvDiablo3Bundle:D3ObjetRarete',
				'property' => 'objetRarete',
				'required'  => false));
	
        $builder->add('Caracteristiques','collection',array('type' => new D3ObjetCaracValeurType(),
						'allow_add'    => true,
                                              'allow_delete' => true,
					      'required'  => false));
	$builder->add('trier', 'choice', array(
	    'choices' => array(
		'p' => 'Prix',
		's' => 'Spe'
	    ),
	    'required'    => false,
	    'empty_data'  => null
	));
	
    }
    
    public function getName()
    {        
        return 'hdvlogindiablo3';
    }
}

?>
